package org.com.coolfish.common.database.repository;

import java.math.BigDecimal;
import java.util.List;

import org.com.coolfish.common.database.entity.KuyuCard;
import org.com.coolfish.common.database.entity.KuyuCardMoney;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface KuyuCardMoneyRepository extends JpaRepository<KuyuCardMoney, Integer> {
  
    
    @Modifying
    @Query("UPDATE KuyuCardMoney cm SET cm.type=2 ,cm.money=:money,cm.addtime=NOW() WHERE cm.card_id=:cardid")
    void changeCardMoney(@Param("money") BigDecimal money,@Param("cardid") Integer cardid);
    
}
